import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
/*
 * GameMenu.java
 *
 * Created on 17 maggio 2008, 16.59
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author udelledo
 */
public class GameMenu extends javax.swing.JMenuBar{
    
    private JMenu file;
    
    private JMenuBar menu;
    
    private JMenuItem newGame;
    
    private JMenuItem loadGame;
    
    private JMenuItem saveGame;
    
    private JMenuItem exit;
    
    private JMenu credits;
    
    /** Creates a new instance of GameMenu */
    public GameMenu() {
        initComponents();
    }
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
        menu = new javax.swing.JMenuBar();
        file = new javax.swing.JMenu();
        newGame = new javax.swing.JMenuItem();
        loadGame = new javax.swing.JMenuItem();
        saveGame = new javax.swing.JMenuItem();
        exit = new javax.swing.JMenuItem();
        credits = new javax.swing.JMenu();
        
        file.setText("File");
        newGame.setText("Nuova Partita");
        newGame.setMnemonic(KeyEvent.VK_N);
        newGame.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
        file.add(newGame);
        
        loadGame.setText("Carica Partita");
        loadGame.setMnemonic(KeyEvent.VK_C);
        loadGame.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
        file.add(loadGame);
        
        saveGame.setText("Salva Partita");
        saveGame.setMnemonic(KeyEvent.VK_S);
        saveGame.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        file.add(saveGame);
        
        exit.setText("Esci");
        exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitActionPerformed(evt);
            }
        });
        exit.setMnemonic(KeyEvent.VK_E);
        exit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
        
        file.add(exit);
        file.setMnemonic(KeyEvent.VK_F);
        menu.add(file);
        
        credits.setText("About");
        credits.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                creditsActionPerformed(evt);
            }
        });
        
        menu.add(credits);
        
    }
    
    public JMenuBar getMenu(){
        return menu;
    }
    
    private void exitActionPerformed(java.awt.event.ActionEvent evt) {
        System.exit(0);
    }
    
    private void creditsActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
    }
}
